<template>
  <div>
      id:<input type="text" v-model="id"><br>
      新闻内容:<input type="text" v-model="content"><br>
      <button @click="add">添加</button>
  </div>
</template>

<script>
export default {
    name:'new_post',
    data(){
        return{
            id:'',
            content:''
        }
    },
    methods:{
        add(){
            let data = new FormData();
            data.append('id',this.id)
            data.append('content',this.content)
            this.axios.post('yt2/',data).then(res=>{
                this.$router.push('new_get')
            })
        }
    }

}
</script>

<style>

</style>